<?php use_helper('I18N') ?>

<form id="login_frm" action="<?php echo url_for('@sf_guard_signin') ?>" method="post">
  <table>
    <tbody>
      <?php foreach($form as $field){
          if($field->getWidget() instanceOf sfWidgetFormInputHidden) continue;
          ?>
        <tr>
            <th><?php echo $field->renderLabel();?></th>
            <td>
                <?php echo $field->render();?>
                <?php echo $field->renderError();?>
            </td>
        </tr> 
      <?php }?>  
    </tbody>
    <tfoot>
      <tr>
        <td colspan="2">
            <?php echo $form->renderHiddenFields(); ?>
          <input type="submit" value="<?php echo __('Signin') ?>" />
        </td>
      </tr>
    </tfoot>
  </table>
    <input type="hidden" name="mode" value="<?php echo isset($mode)?$mode:''?>" />
</form>

<script type="text/javascript">
    $(document).ready(function(){
       $('#login_frm').submit(function(){
          submit_ajax_form('login_frm','login_form_cont'); 
          return false;
       });
    });
</script>    